package com.publicize.controller;


import com.publicize.commom.commonutils.Result;
import com.publicize.entity.ModulePicture;
import com.publicize.service.ModulePictureService;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 富文本编辑器图片路径 前端控制器
 * </p>
 *
 * @author bs
 * @since 2021-03-15
 */
@RestController
@RequestMapping("/backstage/module-picture")
@CrossOrigin
public class ModulePictureController {

    @Autowired
    private ModulePictureService modulePictureService;

    @PostMapping("addmodulePicture")
    public Result addModulePicture(@RequestBody ModulePicture[] modulePictures){
        for (int i=0;i<modulePictures.length;i++){
            modulePictureService.save(modulePictures[i]);
        }
        return Result.ok();
    }

}

